import{glistmessage,clearglistmessage}from "../actionType"

/* 仓库数据 */
const initialstate = {
    goodlist: []
}

/* 执行方法 */
export default (state = initialstate, { type, payload }) => {
let newgoodlist=JSON.parse(JSON.stringify(state))
    switch (type) {
        case glistmessage: newgoodlist.goodlist.push(...payload.goodlist); break;
        case clearglistmessage: newgoodlist.goodlist=[]; break;
        default:break;
    }
    return newgoodlist
}